var entityCollection = require('../../../Base/server/controllers/EntityCollection');

//根据根据工艺路线查找全部工序
exports.findByItemMaster = function(itemMasterId, completeFun){
    var entity = entityCollection.getEntity("Routing");
	entity.findOne({ItemMaster: itemMasterId}, {path: 'ItemMaster'}, function(err, record){
        if(err){
            var newErr = new Error();
            newErr.leval = 9;
            newErr.title = '查询工艺路线错误';
            newErr.message = '查询失败，请检查查询参数！';
            completeFun(newErr);
        }
        else{
            completeFun(null, record);
        }
    });
};
